<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./promise.js"></script>
</head>
<body>
    <h1>自定义Promise--同步改变状态属性</h1>
    <script>
        // 使用自定义的Promise
        const p = new Promise((resolve, reject)=>{
           //resolve("成功了");
           reject("失败了");
        });

        console.log(p);
        // 使用promise
        p.then(value => {
            console.log(value);
        },reason => {
            console.log(reason);
        })


    </script>
</body>
</html>